<template>
  <div class="home">
    <!-- <Transition appear enter-active-class="animate__animated animate__bounceInRight"> -->
    <div class="login-con">
      <div class="logo">
        <img src="@/assets/imgs/logo.png" alt="" />
      </div>
      <div class="logo-title">
        <img src="@/assets/imgs/title.png" alt="" />
      </div>
      <!-- 账号登录 -->
      <LoginForm
        class="m-auto h-auto p-20px lt-xl:(rounded-3xl light:bg-white)"
        style="margin-top: 160px"
      />
      <!-- 手机登录 -->
      <MobileForm class="m-auto h-auto p-20px lt-xl:(rounded-3xl light:bg-white)" />
      <!-- 二维码登录 -->
      <QrCodeForm class="m-auto h-auto p-20px lt-xl:(rounded-3xl light:bg-white)" />
      <!-- 注册 -->
      <RegisterForm class="m-auto h-auto p-20px lt-xl:(rounded-3xl light:bg-white)" />
      <!-- 三方登录 -->
      <SSOLoginVue class="m-auto h-auto p-20px lt-xl:(rounded-3xl light:bg-white)" />
      <!-- 忘记密码 -->
      <!-- <ForgetPasswordForm class="m-auto h-auto p-20px lt-xl:(rounded-3xl light:bg-white)" /> -->
    </div>
    <!-- </Transition> -->
  </div>
</template>
<script lang="ts" setup>
import { underlineToHump } from '@/utils'

import { useDesign } from '@/hooks/web/useDesign'
import { useAppStore } from '@/store/modules/app'
import { ThemeSwitch } from '@/layout/components/ThemeSwitch'
import { LocaleDropdown } from '@/layout/components/LocaleDropdown'

import {
  LoginForm,
  MobileForm,
  QrCodeForm,
  RegisterForm,
  SSOLoginVue,
  ForgetPasswordForm
} from './components'

defineOptions({ name: 'Login' })

const { t } = useI18n()
const appStore = useAppStore()
const { getPrefixCls } = useDesign()
const prefixCls = getPrefixCls('login')
</script>

<style lang="scss" scoped>
$prefix-cls: #{$namespace}-login;

.#{$prefix-cls} {
  overflow: auto;

  &__left {
    &::before {
      position: absolute;
      top: 0;
      left: 0;
      z-index: -1;
      width: 100%;
      height: 100%;
      background-image: url('@/assets/svgs/login-bg.svg');
      background-position: center;
      background-repeat: no-repeat;
      content: '';
    }
  }
}
</style>

<style lang="scss">
.dark .login-form {
  .el-divider__text {
    background-color: var(--login-bg-color);
  }

  .el-card {
    background-color: var(--login-bg-color);
  }
}
.home {
  width: 100vw;
  height: 100vh;
  background-image: url('@/assets/imgs/home.png');
  background-size: 100% 100%;
  position: relative;
  .login-con {
    position: absolute;
    top: 50%;
    left: 80%;
    transform: translate(-50%, -50%);

    width: 464px;
    // height: 533px;
    background: #ffffff;
    overflow: hidden;

    box-shadow:
      10px 10px 20px 0px rgba(50, 96, 195, 0.1),
      -10px -10px 20px 0px rgba(50, 96, 195, 0.1);
    border-radius: 20px 20px 20px 20px;
    .logo {
      //  position: absolute;
      //  top: 20px;
      //  left: 20px;
      margin: 0 auto;
      margin-top: 48px;

      width: 208px;
      height: 79px;

      img {
        width: 100%;
        height: 100%;
      }
    }
    .logo-title {
      //  position: absolute;
      //  top: 20px;
      //  left: 20px;
      margin: 0 auto;
      margin-top: 32px;

      width: 208px;
      height: 36px;

      img {
        width: 100%;
        height: 100%;
      }
    }
  }
}

@media (max-width: 768px) {
  .home .login-con {
    left: 50%;
    width: 90%;
    top: 45%;
    transform: translate(-50%, -45%);
    border-radius: 12px;

    .logo {
      width: 160px;
      height: 60px;
      margin-top: 30px;
    }

    .logo-title {
      width: 160px;
      height: 28px;
      margin-top: 20px;
    }
  }
}

@media (max-width: 576px) {
  .home {
    background-size: auto 100%;

    .login-con {
      width: 95%;
      padding: 0 10px;

      .logo {
        width: 120px;
        height: 45px;
      }

      .logo-title {
        width: 120px;
        height: 22px;
      }
    }
  }

  .login-form {
    :deep(.el-form-item) {
      margin-bottom: 18px;
    }

    :deep(.el-input) {
      height: 40px;

      .el-input__wrapper {
        padding: 0 12px;
      }
    }
  }
}

@media (hover: none) {
  .login-form {
    :deep(.el-button) {
      padding: 12px 20px;
      min-height: 44px;
    }
  }
}
</style>
